Skip to content

Add abs-rel mode and BTN_TOUCH notification.#6

Open
geeksville wants to merge 4 commits intopetejohanson:mainfrom
geeksville:pr-rel-touch
Open

Add abs-rel mode and BTN_TOUCH notification.#6
geeksville wants to merge 4 commits intopetejohanson:mainfrom
geeksville:pr-rel-touch

Conversation

@geeksville
Copy link
Copy Markdown

@geeksville geeksville commented Jan 25, 2026

Hi,

Thanks for making this slick driver. I just used it on my recently purchased Beekeeb Toucan. One issue I noticed is that I wanted a way to get touch notifications. With touch notification I was able to add a layer that instantly turns on/off anytime a finger is touching the trackpad. This allows adding an input processor to switch layers to a layer that remaps some keys to be mouse buttons.

As I'm sure you know - to get touch data (z height) from the pinnacle part the chip needs to be in abs mode. So when this mode is enabled via the device-tree I use the @halfdane existing abs work (included as a dependency for my change) to configure the part. But I do my own math to convert the abs coords into relative moves before forwarding up the stack.

I don't know if you want this as a PR, but if you do here it is. If you have interest I'm happily willing to update the PR to match whatever requirements your project has.

Rock on.


This mode operates the chip in absolute mode (with all of the existing
absolute options).  But reports events as RELATIVE.  This allows use as a
relative touchpad but the addition of EVENT_BTN_TOUCH notifications when
a finger is either on or off of the touchpad.

Such notifications are especially useful to automate instantly switching to/from
a layer that has keys bounds as 'mouse buttons'. (with none of the lag/delays of
'temporary layers' or the cost of constantly sending bluetooth packets between
two halves of a split keybaord)

halfdane and others added 2 commits February 24, 2025 16:47
This mode operates the chip in absolute mode (with all of the existing
absolute options).  But reports events as RELATIVE.  This allows use as a
relative touchpad but the addition of EVENT_BTN_TOUCH notifications when
a finger is either on or off of the touchpad.

Such notifications are especially useful to automate instantly switching to/from
a layer that has keys bounds as 'mouse buttons'. (with none of the lag/delays of
'temporary layers' or the cost of constantly sending bluetooth packets between
two halves of a split keybaord)
@geeksville
Copy link
Copy Markdown
Author

for example usage of this mode see: beekeeb/zmk-keyboard-toucan#7

…rupts

Now that we are counting ZIDLEs it would be very bad to miss one.  But in my testing I see that happen (rarely - once every
couple of days of usage).  The fact that the current irq system is edge triggered probably isn't great for this reason.
But for now just have the touch controller emit NUM_ZIDLE_PAD extra idles
Edge triggered interrupts are not sufficiently robust, if unlucky on scheduling of the worker cb irqs can be missed.
(Seen in actual testing on my board).  Change to level triggered interrupts which guarantee that missed transitions still
get handled.  Also, no need for the in-int flag (even without the level triggering).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants